package com.ssd.controller.operation;


import com.ssd.entity.GiftExchange;
import com.ssd.entity.dto.request.GiftExchangePutReqDTO;
import com.ssd.entity.dto.request.GiftExchangeQueryForPageReqDTO;
import com.ssd.service.IGiftExchangeService;
import com.ssd.viewmodel.Pager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController("operationGiftExchangeController")
@RequestMapping("/operation/giftExchange")
@Api(tags = "客户端-礼品记录表控制器")
@Validated
public class GiftExchangeController {
    @Resource
    private IGiftExchangeService giftExchangeService;


    @ApiOperation("填写兑换礼品的快递信息使用模型")
    @PutMapping("/setExchangeInfo")
    public void setExchangeInfo(@RequestBody GiftExchangePutReqDTO giftExchangePutReqDTO) {
        giftExchangeService.setExchangeInfo(giftExchangePutReqDTO);
    }


    /**
     * 运营端-查询兑换礼品列表
     * @param giftExchangeQueryForPageReqDTO
     * @return
     */
    @GetMapping("/queryGiftExchangeList")
    @ApiOperation(value = "运营端-查询兑换礼品列表")
    public Pager<GiftExchange> queryOperationGiftExchangeList(GiftExchangeQueryForPageReqDTO giftExchangeQueryForPageReqDTO) {
        return giftExchangeService.queryOperationGiftExchangeList(giftExchangeQueryForPageReqDTO);
    }
}
